package com.wn.access.product;

import com.wn.common.model.dto.bank.BankCardRequestDto;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author yellow Docter
 * @date 2023 -07-28
 * @desc
 */
@Component
public class BankRequsetProduct {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    public void sendBankMsg(BankCardRequestDto bankCardRequestDto){

        // 发送消息到  MQ中
        rabbitTemplate.convertAndSend(
                "exchange-bank",

                "bank.access.msg",
                bankCardRequestDto
        );

    }
}
